import {request} from '@/utils/request.js'

const listAll = () => {
    return request.get('/jarManage/listAll')
}

const execute = (jarName, startArgs) => {
    return request.post('/jarManage/execute', {
        jarName, startArgs
    })
}

const killJar = (jarName) => {
    return request.post('/jarManage/stopJar', {
        jarName
    })
}

const delJarFile = (jarName) => {
    return request.post("/jarManage/delJar", {
        jarName
    })
}

const fetchLog = (jarName) => {
    return request.get('/jarManage/getLogs', {
        params: {
            "jarName": jarName,
            "logFile": "output.log",
            "lines": 100
        },
    })
}

export {
    listAll, execute, killJar, delJarFile, fetchLog
}